<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="Keywords" content="<%= sanitize_all(@seo_keywords) || '麦吐司网,免费工具,实用工具,有趣工具,网页工具,在线工具,免费短信' %>"/>
    <meta name="Description" content="<%= sanitize_all(@seo_description) || '麦吐司网-为您提供有趣、实用、免费的在线工具!' %>"/>
    <meta name="google-site-verification" content="CxXqNRJEgky4mQh6iMDmghN-72lvEeQZwsFPzctWBDE" />
    <meta name="chinaz-site-verification" content="ec86d51d-88b2-4689-a7ae-aef2a16ee4f6" />
    <title><%= sanitize_all(@seo_title) || '麦吐司网-为您提供有趣、实用、免费的在线工具!' %></title>
    <link rel="shortcut icon" href="<%= image_path 'favicon.ico' %>">
    <%= javascript_include_tag  :defaults  %>
    <%= stylesheet_link_tag 'base' %>
    <%= yield :css %>
    <%= yield :javascript %>
  </head>
  <script type="text/javascript" charset="utf-8">
    var current_nav_bar_item = null;
    function preview_nav_bar_item(pre_view_item)
    {
      $$('div#nav_bar div.item').each( function (item) {
          if(item.className == 'h item')
          {
            current_nav_bar_item = item;
          }
          item.className = 'item';
        }
      );
      pre_view_item.className = 'h item';
    }
    
    function reset_current_nav_bar_item()
    {
      if(current_nav_bar_item != null)
      {
        $$('div#nav_bar div.item').each( function (item) {
            item.className = 'item';
          }
        );
        current_nav_bar_item.className = 'h item';
      }
    }
  </script>
  <body>
    <div id='mytusi'>    
      <div id="debugger"></div>
      <div id='head'>
        <div id="top">
          <div id="logo">
            <%= image_tag "base/logo.jpg" %>            
          </div>
          <div id="in_taobao">
            <%= link_to '麦吐司淘宝店开张啦! 充话费，送麦粒！！！',
                  "http://mytusi.taobao.com/?userId=&shopId=64737478&view_type=&order_type=&search=y&keyword=#{ (has_logined_by_user? && current_user.default_city.present?) ? to_taobao_uri( current_user.default_city.province.name) : ''}&price1=&price2=",
                  :title => "麦吐司淘宝店开张啦！！！在店里消费的会员送麦粒哦！！！",
                  :target => '_blank' %>
          </div>
          <div class="right">
            <div id="login_info">
              <% if has_logined_by_user? %>
              <div>
                <%= link_to "欢迎#{current_user.nick_name}" , user_url(current_user), :class => :h %>
                |
                <%= link_to "注销", session_url(current_user), :method => :delete, :class => :h1 %>
              </div>
              <% else %>
              <div>
                <%= link_to "您还未登录", new_session_url(:http_referer => @http_referer), :class => :h %>
                |
                <%= link_to "5秒快速注册", new_user_url(:http_referer => @http_referer), :class => :h1 %>
              </div>
              <% end %>
              <div>
                <%= link_to "帮助", helps_url ,:target => :_blank, :title => '帮助' %>
              </div>
              <div>
                <%= link_to_function "设为主页", 'set_to_home()', :title => '将麦吐司网设置成主页' %>
              </div>
              <div class='no_border'>
                <%= link_to_function "加入收藏夹", "add_favorite('http://www.mytusi.com','麦吐司网')", :title => '加入收藏夹' %>
              </div>
            </div>
            <div class="other">
              
            </div>
          </div>          
        </div>
        <div id="nav_bar">
          <div id="top_line">
            <div class='<%= params[:controller] == 'homes' ? 'h':'' %> item' 
                 onmouseover="preview_nav_bar_item(this)" onmouseout='reset_current_nav_bar_item()'>
              <%= link_to "主页", home_url(1) %>
              <span>Home</span>
            </div>
            <div class='<%= params[:controller] == 'tools' ? 'h':'' %> item' 
                 onmouseover="preview_nav_bar_item(this)" onmouseout='reset_current_nav_bar_item()'>
              <%= link_to "吐司大全", tools_url %>
              <span>Tools</span>
            </div>
            <div class='<%= (params[:controller] == 'users'|| params[:controller] == 'user_logos') ? 'h':'' %> item' 
                 onmouseover="preview_nav_bar_item(this)" onmouseout='reset_current_nav_bar_item()'>
              <%= link_to "我的吐司", has_logined_by_user? ? user_url(current_user) : new_session_url(:http_referer => @http_referer) %>
              <span>MyTools</span>
            </div>
            <% if has_logined_by_admin? %>
            <div class='<%= (params[:controller] == 'infos' or params[:controller] == 'tool_types') ? 'h':'' %> item' 
                 onmouseover="preview_nav_bar_item(this)" onmouseout='reset_current_nav_bar_item()'>
              <%= link_to "后台管理", infos_url %>
              <span>Admin</span>
            </div>
            <% end %>
          </div>
          <div id="level_2_nav_bar">
            <%= yield :level_2_nav_bar %>
          </div>
        </div>
      </div>
      <div id='body'>
        <%= yield %>
      </div>
      <div id='bottom'>
        <%= yield :top_of_about_us  %>
        <div id="about_us">
          <div class='top_corner'>
            <div class='left'>
            </div>
            <div class='right'>
            </div>
          </div>
          <div class='body'>
            <ul>
              <li><%= link_to "麦吐司微博", "http://t.sina.com.cn/mytusi", :target => :_blank %></li>
              <li><%= link_to "产品合作", help_url(:id => :about_us), :target => :_blank %></li>
              <li><%= link_to '版权声明', help_url(:id => :copyright), :target => :_blank %></li>
              <li><%= link_to '隐私声明', help_url(:id => :privacy), :target => :_blank %></li>
              <li><%= link_to 'OpenApi', help_url(:id => :open_api), :target => :_blank, :class=> :open_api, :title => '开放API，给您的网站添砖加瓦' %></li>
              <li style="border: 0pt none;">
                <%= link_to "关于麦吐司", help_url(:id => :about_us), :target => :_blank %>
              </li>                
            </ul>
            <div id="footprint">
              网络支持: <a target="_blank" href="mailto:amon.lei@gmail.com">amon.lei</a>&nbsp;
              法律顾问: <a target="_blank" href="http://mengge.5law.cn">孟戈律师</a> &nbsp;
              琼 ICP备<a rel="nofollow" target="_blank" href="http://www.miibeian.gov.cn" tabindex="100">11000187</a>号-1
              <br>
              客服电话: <strong>13976118662</strong>&nbsp;
              在线客服: &nbsp;
              <a title="QQ在线交谈" href="tencent://message/?uin=7861848&amp;Site=www.mytusi.com&amp;Menu=yes"><img border="0" align="absmiddle" alt="QQ在线交谈" src="http://wpa.qq.com/pa?p=1:7861848:4">7861848</a> &nbsp;或&nbsp;<a target="_blank" href="http://qun.qq.com/#jointhegroup/gid/101623826" style='color:#C13301;font-weight:bold;'>加入麦吐司QQ群</a>
              <br>
              <%= link_to '&copy; 2009-2010', help_url(:id => :copyright), :target => :_blank %>
               麦吐司网&trade; All rights reserved.
            </div>
          </div>
          <div class='bottom_corner'>
            <div class='left'>
            </div>
            <div class='right'>
            </div>
          </div>
        </div>
      </div>
    <% if yield(:web_stat) %>  
    	<%= yield :web_stat %>
  	<% elsif Rails.env.production? and not has_logined_by_admin? %>
  		<!-- baidu -->
      <script type="text/javascript">
  		var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
  		document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fd7449d70d933199e5c1eb9e531155ae9' type='text/javascript'%3E%3C/script%3E"));
  		</script>
  		<!-- google -->
  		<script type="text/javascript">		
  		  var _gaq = _gaq || [];
  		  _gaq.push(['_setAccount', 'UA-5471207-3']);
  		  _gaq.push(['_trackPageview']);
  		
  		  (function() {
  		    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  		    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  		    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  		  })();
  		
  		</script>
  	<% end %>
  	<script type="text/javascript" charset="utf-8">
  	  Effect.Pulsate('in_taobao', {duration:60000,pulses:30000});
  	</script>
	  </div>		
  </body>
</html>